import { Controller, Get, Body, Put, Query } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';
import { util_ApiResponse_Base } from '@/common/util/apiResponse';
import { util_Index_ReturnContent } from '@/common/util/index';
import { DistributionApply_Service } from './distributionApply.service';
import { DistributionApply_Find_Dto, DistributionApply_Pass_Dto } from './assets/distributionApply.dto';

@Controller('/adm/distributionApply')
@ApiTags('distributionApply 推广者申请列表')
export class DistributionApply_Controller {
  constructor(private readonly distributionApply_Service: DistributionApply_Service) {}

  @Get('list')
  @util_ApiResponse_Base({
    dataType: 'dataType_list',
  })
  async distributionApply_FindByPage(@Query() query: DistributionApply_Find_Dto) {
    return util_Index_ReturnContent(
      await this.distributionApply_Service.distributionApply_FindByPage(query),
    );
  }

  @Put('/pass')
  @util_ApiResponse_Base({
    dataType: 'dataType_string',
    description: '审核(通过:daStatus传pass,拒绝传refuse)',
    summary: '审核',
  })
  async distributionApply_Pass(@Body() body: DistributionApply_Pass_Dto) {
    return util_Index_ReturnContent(await this.distributionApply_Service.distributionApply_Pass(body));
  }
}
